﻿@using CodeCamp.Models.EventMgmt
@model EventListViewModel

<table>
    <tbody>
        <tr>
            <th>&nbsp;</th>
            <th>Public</th>
            <th>Sched. Public</th>
            <th>Sort</th>
            <th>Short Name</th>
            <th>Display Name</th>
            <th>Start Date /<br />Display Date</th>
            <th>Registration</th>
            <th>Sched Pdf</th>
        </tr>

@foreach (var item in Model.List) {
        <tr>
            <td>
                @Html.ActionLink("Edit", "EditEvent", new { id = item.Id })
                @* @Html.ActionLink("Details", "Details", new { id = item.Id }) | *@
            </td>
            <td>@item.EventIsPublic</td>
            <td>@item.ScheduleIsPublic</td>
            <td>@item.DisplaySortOrder</td>
            <td>@item.ShortName</td>
            <td>@Html.ActionLink(@item.DisplayName, "Index", "Home", new { eventName=@item.ShortName }, null)</td>
            <td>@item.EventStartDate.ToLongDateString()<br />@item.DisplayDate</td>
            <td>
        @if (string.IsNullOrWhiteSpace(item.RegistrationUrl))
        {
            <span>not set</span>
        }
        else if (item.RegistrationUrl.Length == 1)
        {
            <span>@item.RegistrationUrl</span>
        }
        else
        {
            <a href="@item.RegistrationUrl" target="_blank">registration</a>
        }
            </td>
            <td>
            @if (string.IsNullOrWhiteSpace(item.SchedulePdfUrl))
            {
                <span>No Pdf</span>
            }
            else
            {
                <a href="@item.SchedulePdfUrl" target="_blank">PDF</a>
            }
            </td>
        </tr>
}

    </tbody>
</table>
